    function change(cls){
        $(".cur").removeClass('todaycur');
        $("#cls_"+cls).addClass('todaycur');
        if(cls == 1 ){
            count_month();
        }else if(cls == 2) {
            count_day();
        }else if(cls ==3 ) {
            count_referer();
        }else if(cls == 4) {
            count_os();
        }else if(cls == 5) {
            count_ie();
        }else if(cls == 6) {
            count_province();
        }else if(cls == 7) {
            count_spider();
        }else if(cls == 8) {
            count_keyword();
        }else if(cls == 9) {
            count_old();
        }else if(cls == 10) {
            count_day_new();
        }
        
    }

    function pre_ajax() {
        $(".todaydata").html('<img src="'+theme+'images/loading.gif">');
    }

    function getInfo() {
        $.ajax({
            url: service+"/detail?uhash="+uhash,
            dataType: "json",
            success:function(data){
                if(data.code == 'error'){
                    location.href='http://u22.cc/';
                    return;
                }
                //re  = JSON.parse(data);
                re    = data;
                //alert(re.data.id);
                $("#title").html(re.data.title);
                $("#ajax_total_pv").html(re.data.total_pv);
                $(".ajax_1").html(re.data.total_ip);
                $(".ajax_2").html(re.data.days);

                $("#ajax_max_ip_created").html(re.data.created);
                $("#ajax_link").html("<a target='_blank' href='http://u22.cc/"+re.data.uhash+"'>"+re.data.url+"</a>");
                
                //alert(re.data.sina_url);
                //copy_to('http://t.cn/'+re.data.tencent_url,2);
                $("#shot_url").val('http://u22.cc/'+re.data.uhash);
                //$("#shot_url_2").val('http://t.cn/'+re.data.sina_url);
                //$("#shot_url_3").val('http://url.cn/'+re.data.tencent_url);
                //复制到剪切板
                copy_u22('http://u22.cc/'+re.data.uhash);
                //copy_to('http://t.cn/'+re.data.sina_url,2);
                //copy_to('http://t.cn/'+re.data.tencent_url,3);
            },beforeSend:function(){
                //pre_ajax();
            }
        });
    }

    function getCount(){
        $.ajax({
                url: service+"/count?uhash="+uhash,
                dataType: "json",
                success:function(data){
                    //re  = JSON.parse(data);
                    re  = data;
                    if(re.code == 'error'){
                        alert('请刷新页面');
                        return;
                    }
                    re  = re.data

                    if(re.yes_pv == false){
                        $("#ajax_yes_pv").html(0);
                    }else{
                        $("#ajax_yes_pv").html(re.yes_pv);
                    }

                    if(re.yes_ip == false){
                        $("#ajax_yes_ip").html(0);
                    }else{
                        $("#ajax_yes_ip").html(re.yes_ip);
                    }

                    if(re.day_pv == false){
                        $("#ajax_day_pv").html(0);
                    }else{
                        $("#ajax_day_pv").html(re.day_pv);
                    }

                    if(re.day_ip == false){
                        $("#ajax_day_ip").html(0);
                    }else{
                        $("#ajax_day_ip").html(re.day_ip);
                    }

                    $("#ajax_max_pv").html(re.max_pv);
                    $("#ajax_max_ip").html(re.max_ip);
                    $("#ajax_max_ip_date").html(re.max_ip_date);
                    $("#ajax_max_pv_date").html(re.max_pv_date);
                },beforeSend:function(){
                    //pre_ajax();
                }
            });
    }

    function count_month() {
        $.ajax({
                url: api+"/flash_day?uhash="+uhash,
                success:function(data){
                    $(".todaydata").html(data);
                },beforeSend:function(){
                    //pre_ajax();
                }
        });
    }
    
    function count_day() {
        $.ajax({
                url: api+"/flash_hour?uhash="+uhash,
                success:function(data){
                    $(".todaydata").html(data);
                    //$('table').visualize({type: 'line'});
                    //$('table').visualize({type: 'area'});
                    //$('table').visualize();
                },beforeSend:function(){
                    //pre_ajax();
                }
        });
    }
    
    function count_day_new() {
        $.ajax({
                url: api+"/flash_hour_new?uhash="+uhash,
                success:function(data){
                    $(".todaydata").html(data);
                    //$('table').visualize({type: 'line'});
                    //$('table').visualize({type: 'area'});
                    //$('table').visualize();
                },beforeSend:function(){
                    //pre_ajax();
                }
        });
    }

    function count_os() {
        $.ajax({
                url: api+"/flash_os?uhash="+uhash,
                success:function(data){
                    $(".todaydata").html(data);
                },beforeSend:function(){
                    //pre_ajax();
                }
        });
    }
    
    function count_ie() {
        $.ajax({
                url: api+"/flash_ie?uhash="+uhash,
                success:function(data){
                    $(".todaydata").html(data);
                },beforeSend:function(){
                    //pre_ajax();
                }
        });
    }

    function count_referer() {
        $.ajax({
                url: servlet+"/referer_count?uhash="+uhash,
                success:function(data){
                    $(".todaydata").html(data);
                },beforeSend:function(){
                    //pre_ajax();
                }
        });
    }

    function count_province() {
        $.ajax({
                url: servlet+"/province_count?uhash="+uhash,
                success:function(data){
                    $(".todaydata").html(data);
                },beforeSend:function(){
                    //pre_ajax();
                }
        });
    }

    function count_spider() {
        $.ajax({
                url: servlet+"/spider_count?uhash="+uhash,
                success:function(data){
                    $(".todaydata").html(data);
                },beforeSend:function(){
                    //pre_ajax();
                }
        });
    }

    function count_keyword() {
        $(".todaydata").html('暂无数据');
    }

    function count_old() {
        $(".todaydata").html('暂无数据');
    }
    var u22_copy    = null;
    
    function copy_u22(value){
            u22_copy = new ZeroClipboard.Client();
            u22_copy.setHandCursor( true );
            u22_copy.setText(value);
            u22_copy.glue('button');
            u22_copy.addEventListener( "complete", function(){
                alert("复制成功！");
            });
    }

    function copy_to(value,id){
            var u22_copy    = null;
            u22_copy = new ZeroClipboard.Client();
            u22_copy.setHandCursor( true );
            u22_copy.setText(value);
            u22_copy.glue('button_'+id);
            u22_copy.show();
            u22_copy.addEventListener( "complete", function(){
                alert("复制成功！");
            });
            
    }